import React from 'react';
import {WeaNewScroll} from 'ecCom';

class SearchRcmd extends React.Component {
    render() {
        const {data = []} = this.props;
        return (
            <div className="wea-em-portal-menu-search-rcmd-content">
                <div className="wea-em-portal-menu-search-rcmd-result">
                    <WeaNewScroll height="100%">
                        <div className="wea-em-portal-menu-search-rcmd-list">
                            <ul>
                                {
                                    data.map((item, index) => {
                                        return (
                                            <li key={index} title={item.name} onClick={() => this.props.onOpenMenu(item.url)}>
                                                <div className={`wea-em-portal-menu-search-rcmd-icon wevicon-module wevicon-module-${item.moduleId}`}><i/></div>
                                                <span className="wea-em-portal-menu-search-rcmd-name">{item.name}</span>
                                            </li>
                                        );
                                    })
                                }
                            </ul>
                        </div>
                    </WeaNewScroll>
                </div>
            </div>
        );
    }
}

export default SearchRcmd;